package com.tianqu.tms.www.transfer.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.entity.TransferStatusCount;
import com.tianqu.tms.www.transfer.viewhelper.CheckConfirmViewHelper;

public class SpecialCarStatusSearchInputTopAction extends TmsAction {

	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			UserContext uc) throws Exception {

		CheckConfirmViewHelper view = (CheckConfirmViewHelper) uc
				.getAttribute(TmsConstants.VIEWHELP);
		// 根据weekId载入列表信息
		TransferStatusCount count = new TransferStatusCount();
		count = count
				.getTransferStatusCountByWeekId(view.getStatusSearchTime());
		// 根据weekId查询时间
		TransferStatusCount count1 = new TransferStatusCount();
		count1 = count1.getTransferStatusCountInfo(view.getStatusSearchTime());

		view.setCount1(count.getCount1());
		view.setCount2(count.getCount2());
		view.setCount3(count.getCount3());
		view.setCount4(count.getCount4());
		view.setCount5(count.getCount5());
		view.setCount6(count.getCount6());

		view.setStatusSearchTime(count1.getCountDay());

		request.setAttribute(TmsConstants.VIEWHELP, view);
		return mapping.findForward(TmsConstants.SUCCESS);
	}

}
